Skip to content

Conversation

@REALMarrtyFDGU
Copy link

No description provided.

@vercel
Copy link

vercel bot commented Jan 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
penguinmod-extensions-gallery Ready Ready Preview Jan 2, 2026 4:44pm

@Steve0Greatness
Copy link
Contributor

Just an FYI for future reference: you don't need to create new PRs for new changes on GitHub. If you push to the same branch it will update the PR to include the changes on that branch.

Copy link
Contributor

@Steve0Greatness Steve0Greatness Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it matters for this PR (it can always be changed later) but AVIF is generally expected for thumbnails. You should probably either convert it on your own machine or look for an online converter to convert it for you, then upload it with the same basename but with .avif for the extension; also remember to update extensions.js to point to the AVIF version instead of the PNG.

const date = new Date(args.DATE);
const timestamp = date.getTime();

if (isNaN(timestamp)) return "Invalid Date";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's an issue that cannot be continued from, you should throw, not return. Throw will render an error message on the GUI and highlight the script that had an issue, returning doesn't.

Comment on lines +42 to +52
// Create an 8-byte buffer
const buffer = new ArrayBuffer(8);
const view = new DataView(buffer);

// Write as Big-Endian 64-bit integer
// Note: BigInt is used because JS numbers lose precision above 53 bits
view.setBigUint64(0, BigInt(timestamp), false);

// Convert buffer to Hex string
return Array.from(new Uint8Array(buffer))
.map(b => b.toString(16).padStart(2, '0'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lot of work for something that is seemingly replicated perfectly fine with .toString(16).padStart(16, '0').toUpperCase(). Although feel free to correct me if I'm wrong, here.

Comment on lines +59 to +64
const hex = args.HEX.replace(/\s/g, '');
const bytes = new Uint8Array(hex.match(/.{1,2}/g).map(byte => parseInt(byte, 16)));
const view = new DataView(bytes.buffer);

// Read as Big-Endian 64-bit integer
const timestamp = Number(view.getBigUint64(0, false));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yet again, I think this entire area could fairly well replaced with a singular call to parseInt, with the second parameter set to 16, to make sure it knows to parse as a 16 bit integer.

const timestamp = Number(view.getBigUint64(0, false));
return new Date(timestamp).toString();
} catch (e) {
return "Invalid Hex";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once more, throw here. I really dislike seeing areas where random bugs can occur for no reason without even being able to track down where it's going on.

Comment on lines +8 to +14
{
name: "Date to Hex",
description: "Blocks to change a date to hex and vice versa.",
code: "AeroHutch/date-to-hex.js",
banner: "AeroHutch/date-to-hex.png",
creator: "AeroHutch",
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd put this at least a little further down in the list. Maybe next to format numbers and date format.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please be consistent about your usage of single quotes (') or double quotes (") for strings in this file. There really isn't a difference between the two (not in JavaScript, at least), you can easily interchange them. Given you use single quotes most often, I'd replace the double quotes in this file with single quotes.


if (isNaN(timestamp)) return "Invalid Date";

// Create an 8-byte buffer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is pointless; comments should be used exceedingly sparingly, generally.

Comment on lines +46 to +48
// Write as Big-Endian 64-bit integer
// Note: BigInt is used because JS numbers lose precision above 53 bits
view.setBigUint64(0, BigInt(timestamp), false);
Copy link
Contributor

@Steve0Greatness Steve0Greatness Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Big endian is the default mode of this method, anyway. Specifying it to be written in big endian in a bit pointless: DataView.prototype.setBigUint64() littleEndian.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants